Skip to content

feat: support default backend in cosmo ingress#2398

Merged
pepol merged 1 commit intomainfrom
peter/support-default-backend
Dec 9, 2025
Merged

feat: support default backend in cosmo ingress#2398
pepol merged 1 commit intomainfrom
peter/support-default-backend

Conversation

@pepol
Copy link
Copy Markdown
Member

@pepol pepol commented Dec 8, 2025

Summary by CodeRabbit

  • New Features
    • Optional default backend for Ingress: when configured, a default backend service and port will be included in generated manifests.
  • Documentation
    • Added a commented example in configuration values showing how to enable and specify the default backend.

✏️ Tip: You can customize this high-level summary in your review settings.

Checklist

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Dec 8, 2025

Walkthrough

Adds an optional defaultBackend block to the Helm Ingress template, emitted only when .Values.ingress.defaultBackend is set. The template emits either the modern defaultBackend.service.name/port.number form for Kubernetes >=1.19.0 or the legacy backend.serviceName/backend.servicePort form for older versions. values.yaml includes a commented example.

Changes

Cohort / File(s) Summary
Ingress template changes
helm/cosmo/templates/ingress.yaml
Inserted a conditional defaultBackend block under the Ingress spec, gated by .Values.ingress.defaultBackend. Chooses modern (defaultBackend.service.name + port.number) or legacy (backend.serviceName + backend.servicePort) fields based on Kubernetes version checks. Existing rules and fields preserved.
Values documentation
helm/cosmo/values.yaml
Added a commented ingress.defaultBackend example showing name and port keys (not enabled by default).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Check Helm conditional syntax and indentation in helm/cosmo/templates/ingress.yaml.
  • Verify Kubernetes version comparison logic and that both backend formats render valid YAML for target cluster versions.
  • Confirm .Values.ingress.defaultBackend.name and .Values.ingress.defaultBackend.port are referenced correctly and match documented example in values.yaml.

Pre-merge checks

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding support for default backend configuration in the cosmo Helm ingress template.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f1722b4 and 5e85301.

📒 Files selected for processing (2)
  • helm/cosmo/templates/ingress.yaml (1 hunks)
  • helm/cosmo/values.yaml (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-08-15T10:21:45.838Z
Learnt from: StarpTech
Repo: wundergraph/cosmo PR: 2142
File: helm/cosmo/Chart.yaml:0-0
Timestamp: 2025-08-15T10:21:45.838Z
Learning: In the WunderGraph Cosmo project, helm chart version upgrades and README badge synchronization are handled in separate helm release PRs, not in the initial version bump PRs.

Applied to files:

  • helm/cosmo/templates/ingress.yaml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: build_test
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Analyze (go)
🔇 Additional comments (2)
helm/cosmo/values.yaml (1)

114-116: Documentation example aligns with template structure.

The commented defaultBackend block provides clear guidance for users on how to configure the feature. The field names match what the template expects.

helm/cosmo/templates/ingress.yaml (1)

38-50: Correct API version-specific defaultBackend syntax.

The implementation properly addresses the Kubernetes API version compatibility concern that was previously flagged. The version check on Line 39 aligns with the main API version selector (Line 8), ensuring the correct defaultBackend syntax is rendered:

  • Kubernetes ≥1.19 (networking.k8s.io/v1): defaultBackend.service.name and .service.port.number
  • Kubernetes <1.19 (v1beta1/extensions): backend.serviceName and servicePort

Conditional gating on Line 38 ensures the block is only emitted when configured, so existing behavior is preserved by default.

Tip

✨ Issue Enrichment is now available for GitHub issues!

CodeRabbit can now help you manage issues more effectively:

  • Duplicate Detection — Identify similar or duplicate issues
  • Related Issues & PRs — Find relevant issues and PR's from your repository
  • Suggested Assignees — Find the best person to work on the issue
  • Implementation Planning — Generate detailed coding plans for engineers and agents
Disable automatic issue enrichment

To disable automatic issue enrichment, add the following to your .coderabbit.yaml:

issue_enrichment:
  auto_enrich:
    enabled: false

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d23f439 and f1722b4.

📒 Files selected for processing (2)
  • helm/cosmo/templates/ingress.yaml (1 hunks)
  • helm/cosmo/values.yaml (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Analyze (go)
  • GitHub Check: build_test
🔇 Additional comments (1)
helm/cosmo/values.yaml (1)

114-116: LGTM!

The commented example clearly documents the new defaultBackend configuration with the expected structure (name and port), and follows the existing documentation style in the file.

Comment thread helm/cosmo/templates/ingress.yaml
@pepol pepol force-pushed the peter/support-default-backend branch 2 times, most recently from e35212b to e902f65 Compare December 8, 2025 16:43
@pepol pepol force-pushed the peter/support-default-backend branch from e902f65 to 5e85301 Compare December 9, 2025 17:59
@pepol pepol enabled auto-merge (squash) December 9, 2025 17:59
@pepol pepol merged commit d2d00cd into main Dec 9, 2025
10 checks passed
@pepol pepol deleted the peter/support-default-backend branch December 9, 2025 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants